<?php

namespace Caisse\CaisseBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Categorie
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Caisse\CaisseBundle\Entity\CategorieRepository")
 */
class Categorie
{
     /**
     * @ORM\OneToMany(targetEntity="Caisse\CaisseBundle\Entity\Article", mappedBy="categorie" , cascade={"remove"})
     */
    private $articles;
    

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom_ca", type="string", length=255)
     */
    private $nomCa;

    /**
     * @var string
     *
     * @ORM\Column(name="description_ca", type="text")
     */
    private $descriptionCa;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nomCa
     *
     * @param string $nomCa
     * @return Categorie
     */
    public function setNomCa($nomCa)
    {
        $this->nomCa = $nomCa;
    
        return $this;
    }

    /**
     * Get nomCa
     *
     * @return string 
     */
    public function getNomCa()
    {
        return $this->nomCa;
    }

    /**
     * Set descriptionCa
     *
     * @param string $descriptionCa
     * @return Categorie
     */
    public function setDescriptionCa($descriptionCa)
    {
        $this->descriptionCa = $descriptionCa;
    
        return $this;
    }

    /**
     * Get descriptionCa
     *
     * @return string 
     */
    public function getDescriptionCa()
    {
        return $this->descriptionCa;
    }
    public function __toString() {
        return $this->getNomCa();
    }

    /**
     * Set articles
     *
     * @param \Caisse\CaisseBundle\Entity\Article $articles
     * @return categorie
     */
    public function setArticle(\Caisse\CaisseBundle\Entity\Article $articles)
    {
        $this->articles = $articles;
    
        return $this;
    }

    /**
     * Get articles
     *
     * @return \Caisse\CaisseBundle\Entity\Article 
     */
    public function getArticle()
    {
        return $this->articles;
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->articles = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add articles
     *
     * @param \Caisse\CaisseBundle\Entity\Article $articles
     * @return Categorie
     */
    public function addArticle(\Caisse\CaisseBundle\Entity\Article $articles)
    {
        $this->articles[] = $articles;
    
        return $this;
    }

    /**
     * Remove articles
     *
     * @param \Caisse\CaisseBundle\Entity\Article $articles
     */
    public function removeArticle(\Caisse\CaisseBundle\Entity\Article $articles)
    {
        $this->articles->removeElement($articles);
    }

    /**
     * Get articles
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getArticles()
    {
        return $this->articles;
    }
}